<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE>
<html>
   <head>
   	   <meta charset="utf8">
   	   <meta name="viewport" content="width=device-width, initial-scale=1">
       <link rel="stylesheet" type="text/css" href="/aquaticproduct/Public/css/bootstrap.min.css">
       <link rel="stylesheet" type="text/css" href="/aquaticproduct/Public/css/sticky-footer-navbar.css">

       <script type="application/javascript" src="/aquaticproduct/Public/js/jquery-1.11.1.min.js"></script>
       <script type="application/javascript" src="/aquaticproduct/Public/js/bootstrap.min.js"></script>
   	   
   	   <title>水产品质量溯源系统</title>

   </head>
<body>
    <!-- Fixed navbar -->
    <nav class="navbar navbar-default navbar-fixed-top">
      <div class="container">
	        <div class="navbar-header">
	          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
	            <span class="sr-only">Toggle navigation</span>
	            <span class="icon-bar"></span>
	            <span class="icon-bar"></span>
	            <span class="icon-bar"></span>
	          </button>
	          <a class="navbar-brand" href="#">水产品质量溯源系统</a>
	        </div>
	        <div id="navbar" class="collapse navbar-collapse">
	          <ul class="nav navbar-nav">
	            <li class="dropdown">
	            	<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">个人中心<span class="caret"></span></a>
	            	   <ul class="dropdown-menu">
		                <li><a href="<?php echo U('Home/User/showMe',array('role'=> '1'));?>">个人信息</a></li>
		                <li><a style="color:red" href="<?php echo U('Home/Index/logout');?>">退出</a></li>	                
		              </ul>
	            </li> 
	            <li class="dropdown">
	              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">用户中心 <span class="caret"></span></a>
	              <ul class="dropdown-menu">
	                <li><a href="<?php echo U('Superadmin/User/index');?>">注册用户</a></li>

	                <li><a href="<?php echo U('Superadmin/User/manage');?>">用户管理</a></li>
	              </ul>
	            </li>
	            <li class="dropdown">
	              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">功能列表 <span class="caret"></span></a>
	              <ul class="dropdown-menu">
	                <li><a href="<?php echo U('Superadmin/Safe/index');?>">基地基本信息</a></li>

	                <li><a href="#"></a></li>
	              </ul>
	            </li>
	          </ul>
	          <a class="navbar-brand " href="#">|&nbsp&nbsp&nbsp&nbsp系统管理员</a>
	        </div><!--/.nav-collapse -->
      </div>
    </nav>
    

   
<div class="container">
	
	<div class="row">
		<!-- <a href=""><button class="btn btn-success">  修改基地信息</button></a> -->
		<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#addBaseModal">       添加基地
		</button>
		<table class="table table-bordered table-striped col-sm-12" >
	     <caption>基地基本信息:</caption>
		     <thead>
		        <tr>
		           <th>基地编号</th>
		           <th>基地名称</th>
		           <th>地理位置</th>
		           <th>水质来源</th>
		           <th>基地规模</th>
		           <th>联系人</th>
		           <th>联系电话</th>
                   <th>经纬度列表</th>
		           <th>创建时间</th>
		           <th>操作</th>
		        </tr>
		     </thead>
		     <tbody>
		     	<?php if(is_array($base_data)): $i = 0; $__LIST__ = $base_data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
			           <td><?php echo ($vo["base_id"]); ?></td>
			           <td><?php echo ($vo['base_name']); ?></td>
			           <td><?php echo ($vo['base_addr']); ?></td>
			           <td><?php echo ($vo['base_source_water']); ?></td>
	                   <td><?php echo ($vo['base_scale']); ?></td>
			           <td><?php echo ($vo['base_contacts']); ?></td>
			           <td><?php echo ($vo['base_tel']); ?></td>
			           <td><?php echo ($vo['base_coordinate']); ?></td>
			           <td><?php echo ($vo['base_time']); ?></td>
			           <td><button class="btn btn-danger" data-toggle="modal" data-target="#modifyBaseModal" id="modifyButton" value="<?php echo ($vo["base_id"]); ?>" onclick="baseChange(this)">修改</button></td>
			        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
		     </tbody>
 		 </table>
	</div><hr>
	 <div class="row">
      	<button class="btn btn-lg btn-primary"  data-toggle="modal" data-target="#addFeedModal">添加饲料</button>
		<table class="table table-bordered table-striped col-sm-12" >
	     <caption>饲料信息:</caption>
		     <thead>
		        <tr>	        	
		           <th>饲料名称</th>
		           <th>饲料规格</th>
		           <th>操作</th>
		           
		        </tr>
		     </thead>
		     <tbody>
		     	  <?php if(is_array($feed)): $i = 0; $__LIST__ = $feed;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$feed): $mod = ($i % 2 );++$i;?><tr>
			           <td><?php echo ($feed["feed_name"]); ?></td>
			           <td><?php echo ($feed["feed_specifications"]); ?></td>
			           <td><button class="btn btn-danger" data-toggle="modal" data-target="#modifyFeedModal" id="modifyButton" value="<?php echo ($feed["feed_id"]); ?>" onclick="feedChange(this)">修改</button></td>
			        </tr><?php endforeach; endif; else: echo "" ;endif; ?>  
		     </tbody>
 		 </table>
	</div><hr>
	 <div class="row">
      	<button class="btn btn-lg btn-primary"  data-toggle="modal" data-target="#addFryModal">添加鱼苗</button>
		<table class="table table-bordered table-striped col-sm-12" >
	     <caption>鱼苗信息:</caption>
		     <thead>
		        <tr>	        	
		           <th>名称</th>
		           <th>操作</th>
		        </tr>
		     </thead>
		     <tbody>
		     	<?php if(is_array($fry)): $i = 0; $__LIST__ = $fry;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$fry): $mod = ($i % 2 );++$i;?><tr>
			           <td><?php echo ($fry["fry_name"]); ?></td>
			           <td><button class="btn btn-danger" data-toggle="modal" data-target="#modifyFryModal" id="modifyButton" value="<?php echo ($fry["fry_id"]); ?>" onclick="fryChange(this)">修改</button></td>
			        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
		     </tbody>
 		 </table>
	</div><hr>
	<div class="row">
      	<button class="btn btn-lg btn-primary"  data-toggle="modal" data-target="#addMedicineModal">添加药品</button>
		<table class="table table-bordered table-striped col-sm-12" >
	     <caption>药品信息:</caption>
		     <thead>
		        <tr>	        	
		           <th>名称</th>
		           <th>用途</th>
		           <th>注意事项</th>
		           <th>操作</th>
		        </tr>
		     </thead>
		     <tbody>
		     	<?php if(is_array($medicine)): $i = 0; $__LIST__ = $medicine;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$medicine): $mod = ($i % 2 );++$i;?><tr>
			           <td><?php echo ($medicine["medicine_name"]); ?></td>
			           <td><?php echo ($medicine["medicine_use"]); ?></td>
			           <td><?php echo ($medicine["medicine_precautions"]); ?></td>
			           <td><button class="btn btn-danger" data-toggle="modal" data-target="#modifyMedicineModal" id="modifyButton" value="<?php echo ($medicine["medicine_id"]); ?>" onclick="medicineChange(this)">修改</button></td>
			        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
		     </tbody>
 		 </table>
	</div><hr>
	
</div>
<!-- modifybase模态框（Modal） -->
<div class="modal fade" id="modifyBaseModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
		   <div class="modal-dialog">
		      <div class="modal-content">
		         <div class="modal-header">
		            <button type="button" class="close" 
		               data-dismiss="modal" aria-hidden="true">
		                  &times;
		            </button>
		            <h4 class="modal-title" id="myModalLabel">
		               信息修改
		            </h4>
		         </div>
		         <div class="modal-body">
		            <form action="<?php echo U('Superadmin/Safe/modifyBase');?>" id="modifyBase_form"role="form" method="post">
		            	
		            	<div class="form-group">
		            		<label for="">基地编号</label>
		            		<input type="text" class="form-control" value="" name="base_id" id="base_id" readonly>
		            	</div>
		            	<div class="form-group">
		            		<label for="">基地名称</label>
		            		<input type="text" class="form-control" value="" name="base_name" id="base_name">
		            	</div>
		            	<div class="form-group">
		            		<label for="">地理位置</label>
		            		<input type="text" class="form-control" value="<?php echo ($base_data['base_addr']); ?>" name="base_addr" id="base_addr">
		            	</div>
		            	<div class="form-group">
		            		<label for="">水质来源</label>
		            		<input type="text" class="form-control" value="<?php echo ($base_data['base_source_water']); ?>" name="base_source_water" id="base_source_water">
		            	</div>
		            	<div class="form-group">
		            		<label for="">基地规模</label>
		            		<input type="text" class="form-control" value="<?php echo ($base_data['base_scale']); ?>" name="base_scale" id="base_scale">
		            	</div>
		            	<div class="form-group">
		            		<label for="">联系人</label>
		            		<input type="text" class="form-control" value="<?php echo ($base_data['base_contacts']); ?>" name="base_contacts" id="base_contacts">
		            	</div>
		            	<div class="form-group">
		            		<label for="">联系电话</label>
		            		<input type="text" class="form-control" value="<?php echo ($base_data['base_tel']); ?>" name="base_tel" id="base_tel">
		            	</div>
		            	<div class="form-group">
		            		<label for="">经纬度列表</label>
		            		<input type="text" class="form-control" value="<?php echo ($base_data[ 'base_coordinate']); ?>" name="base_coordinate" id="base_coordinate">
		            	</div>
                        <label class="control-label" for="input01" name="time">当前时间: <?php echo ($time); ?> </label>
		            </form>
		         </div>
		         <div class="modal-footer">
		            <button type="button" class="btn btn-default" 
		               data-dismiss="modal">关闭
		            </button>
		            <button type="button"  id="modifyBaseBtn" class="btn btn-primary">
		               提交更改
		            </button>
		         </div>
		      </div><!-- /.modal-content -->
		</div><!-- /.modal -->
</div>

<!-- addpool模态框（Modal） -->
<div class="modal fade" id="addBaseModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
		   <div class="modal-dialog">
		      <div class="modal-content">
		         <div class="modal-header">
		            <button type="button" class="close" 
		               data-dismiss="modal" aria-hidden="true">
		                  &times;
		            </button>
		            <h4 class="modal-title" id="myModalLabel">
		               新基地信息
		            </h4>
		         </div>
		         <div class="modal-body">
		            <form action="<?php echo U('Superadmin/Safe/addBase');?>" id="addBase_form" role="form" method="post">
		            	<div class="form-group">
		            		<label for="">基地名称</label>
		            		<input type="text" class="form-control" value="" name="base_name" id="base_name">
		            	</div>
		            	<div class="form-group">
		            		<label for="">地理位置</label>
		            		<input type="text" class="form-control" value="" name="base_addr" id="base_addr">
		            	</div>
		            	<div class="form-group">
		            		<label for="">水质来源</label>
		            		<input type="text" class="form-control" value="" name="base_source_water" id="base_source_water">
		            	</div>
		            	<div class="form-group">
		            		<label for="">基地规模</label>
		            		<input type="text" class="form-control" value="" name="base_scale" id="base_scale">
		            	</div>
		            	<div class="form-group">
		            		<label for="">联系人</label>
		            		<input type="text" class="form-control" value="" name="base_contacts" id="base_contacts">
		            	</div>
		            	<div class="form-group">
		            		<label for="">联系电话</label>
		            		<input type="text" class="form-control" value="" name="base_tel" id="base_tel">
		            	</div>
		            	<div class="form-group">
		            		<label for="">经纬度列表</label>
		            		<input type="text" class="form-control" value="" name="base_coordinate" id="base_coordinate">
		            	</div>
		            	<label class="control-label" for="input01" name="time">当前时间: <?php echo ($time); ?> </label>

		            </form>
		         </div>
		         <div class="modal-footer">
		            <button type="button" class="btn btn-default" 
		               data-dismiss="modal">关闭
		            </button>
		            <button type="button"  id="addBaseBtn" class="btn btn-primary">
		               提交
		            </button>
		         </div>
		      </div><!-- /.modal-content -->
		</div><!-- /.modal -->

</div>
<!-- feedModal -->
<div class="modal fade" id="addFeedModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
		   <div class="modal-dialog">
		      <div class="modal-content">
		         <div class="modal-header">
		            <button type="button" class="close" 
		               data-dismiss="modal" aria-hidden="true">
		                  &times;
		            </button>
		            <h4 class="modal-title" id="myModalLabel">
		               新饲料信息
		            </h4>
		         </div>
		         <div class="modal-body">
		            <form action="<?php echo U('Superadmin/Safe/addFeed');?>" id="addFeed_form" role="form" method="post">
		            	<div class="form-group">
		            		<label for="">饲料名称</label>
		            		<input type="text" class="form-control" value="" name="feed_name" >
		            	</div>
		            	<div class="form-group">
		            		<label for="">饲料规格</label>
		            		<input type="text" class="form-control" value="" name="feed_specifications">
		            	</div>
		            	<label class="control-label" for="input01" name="time">当前时间: <?php echo ($time); ?> </label>
		                
		            </form>
		         </div>
		         <div class="modal-footer">
		            <button type="button" class="btn btn-default" 
		               data-dismiss="modal">关闭
		            </button>
		            <button type="button"  id="addFeedBtn" class="btn btn-primary">
		               提交
		            </button>
		         </div>
		      </div><!-- /.modal-content -->
		</div><!-- /.modal -->

</div>

<!-- ModifyfeedModal -->
<div class="modal fade" id="modifyFeedModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
		   <div class="modal-dialog">
		      <div class="modal-content">
		         <div class="modal-header">
		            <button type="button" class="close" 
		               data-dismiss="modal" aria-hidden="true">
		                  &times;
		            </button>
		            <h4 class="modal-title" id="myModalLabel">
		               修改饲料信息
		            </h4>
		         </div>
		         <div class="modal-body">
		            <form action="<?php echo U('Superadmin/Safe/modifyFeed');?>" id="modifyFeed_form" role="form" method="post">
		            	<div class="form-group">
		            		<label for="">饲料名称</label>
		            		<input type="text" class="form-control" value="" name="feed_name" id="feed_name">
		            	</div>
		            	<div class="form-group">
		            		<label for="">饲料规格</label>
		            		<input type="text" class="form-control" value="" name="feed_specifications" id="feed_specifications">
		            	</div>
		            	<label class="control-label" for="input01" name="time">当前时间: <?php echo ($time); ?> </label>
		                <div class="form-group hidden">
		            		<input type="text" class="form-control" value="" name="feed_id" id="feed_id" >
		            	</div>
		            </form>
		         </div>
		         <div class="modal-footer">
		            <button type="button" class="btn btn-default" 
		               data-dismiss="modal">关闭
		            </button>
		            <button type="button"  id="modifyFeedBtn" class="btn btn-primary">
		               提交
		            </button>
		         </div>
		      </div><!-- /.modal-content -->
		</div><!-- /.modal -->
</div>

<!-- fryModal -->
<div class="modal fade" id="addFryModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
		   <div class="modal-dialog">
		      <div class="modal-content">
		         <div class="modal-header">
		            <button type="button" class="close" 
		               data-dismiss="modal" aria-hidden="true">
		                  &times;
		            </button>
		            <h4 class="modal-title" id="myModalLabel">
		               新鱼苗信息
		            </h4>
		         </div>
		         <div class="modal-body">
		            <form action="<?php echo U('Superadmin/Safe/addFry');?>" id="addFry_form" role="form" method="post">
		            	<div class="form-group">
		            		<label for="">鱼苗名称</label>
		            		<input type="text" class="form-control" value="" name="fry_name" >
		            	</div>
		            	<label class="control-label" for="input01" name="time">当前时间: <?php echo ($time); ?> </label>
		            </form>
		         </div>
		         <div class="modal-footer">
		            <button type="button" class="btn btn-default" 
		               data-dismiss="modal">关闭
		            </button>
		            <button type="button"  id="addFryBtn" class="btn btn-primary">
		               提交
		            </button>
		         </div>
		      </div><!-- /.modal-content -->
		</div><!-- /.modal -->

</div>

<!-- ModifyfryModal -->
<div class="modal fade" id="modifyFryModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
		   <div class="modal-dialog">
		      <div class="modal-content">
		         <div class="modal-header">
		            <button type="button" class="close" 
		               data-dismiss="modal" aria-hidden="true">
		                  &times;
		            </button>
		            <h4 class="modal-title" id="myModalLabel">
		               修改鱼苗信息
		            </h4>
		         </div>
		         <div class="modal-body">
		            <form action="<?php echo U('Superadmin/Safe/modifyFry');?>" id="modifyFry_form" role="form" method="post">
		            	<div class="form-group">
		            		<label for="">鱼苗名称</label>
		            		<input type="text" class="form-control" value="" name="fry_name" id="fry_name">
		            	</div>
		            	
		            	<label class="control-label" for="input01" name="time">当前时间: <?php echo ($time); ?> </label>
		                <div class="form-group hidden">
		            		<input type="text" class="form-control" value="" name="fry_id" id="fry_id" >
		            	</div>
		            </form>
		         </div>
		         <div class="modal-footer">
		            <button type="button" class="btn btn-default" 
		               data-dismiss="modal">关闭
		            </button>
		            <button type="button"  id="modifyFryBtn" class="btn btn-primary">
		               提交
		            </button>
		         </div>
		      </div><!-- /.modal-content -->
		</div><!-- /.modal -->
</div>
<!-- medicineModal -->
<div class="modal fade" id="addMedicineModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
		   <div class="modal-dialog">
		      <div class="modal-content">
		         <div class="modal-header">
		            <button type="button" class="close" 
		               data-dismiss="modal" aria-hidden="true">
		                  &times;
		            </button>
		            <h4 class="modal-title" id="myModalLabel">
		               新药品信息
		            </h4>
		         </div>
		         <div class="modal-body">
		            <form action="<?php echo U('Superadmin/Safe/addMedicine');?>" id="addMedicine_form" role="form" method="post">
		            	<div class="form-group">
		            		<label for="">药品名称</label>
		            		<input type="text" class="form-control" value="" name="medicine_name" >
		            	</div>
		            	<div class="form-group">
		            		<label for="">用途</label>
		            		<input type="text" class="form-control" value="" name="medicine_use">
		            	</div>
		            	<div class="form-group">
		            		<label for="">注意事项</label>
		            		<textarea class="form-control" value="" name="medicine_precautions">
		            		</textarea>
		            	</div>
		            	<label class="control-label" for="input01" name="time">当前时间: <?php echo ($time); ?> </label>
		            </form>
		         </div>
		         <div class="modal-footer">
		            <button type="button" class="btn btn-default" 
		               data-dismiss="modal">关闭
		            </button>
		            <button type="button"  id="addMedicineBtn" class="btn btn-primary">
		               提交
		            </button>
		         </div>
		      </div><!-- /.modal-content -->
		</div><!-- /.modal -->

</div>

<!-- ModifymedicineModal -->
<div class="modal fade" id="modifyMedicineModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
		   <div class="modal-dialog">
		      <div class="modal-content">
		         <div class="modal-header">
		            <button type="button" class="close" 
		               data-dismiss="modal" aria-hidden="true">
		                  &times;
		            </button>
		            <h4 class="modal-title" id="myModalLabel">
		               修改药品信息
		            </h4>
		         </div>
		         <div class="modal-body">
		            <form action="<?php echo U('Superadmin/Safe/modifyMedicine');?>" id="modifyMedicine_form" role="form" method="post">
		            	<div class="form-group">
		            		<label for="">药品名称</label>
		            		<input type="text" class="form-control" value="" name="medicine_name" id="medicine_name">
		            	</div>
		            	<div class="form-group">
		            		<label for="">用途</label>
		            		<input type="text" class="form-control" value="" name="medicine_use" id="medicine_use">
		            	</div>
		            	<div class="form-group">
		            		<label for="">注意事项</label>
		            		<textarea class="form-control" value="" name="medicine_precautions" id="medicine_precautions"> </textarea>
		            	</div>
		            	<label class="control-label" for="input01" name="time">当前时间: <?php echo ($time); ?> </label>
		                <div class="form-group hidden">
		            		<input type="text" class="form-control" value="" name="medicine_id" id="medicine_id" >
		            	</div>
		            </form>
		         </div>
		         <div class="modal-footer">
		            <button type="button" class="btn btn-default" 
		               data-dismiss="modal">关闭
		            </button>
		            <button type="button"  id="modifyMedicineBtn" class="btn btn-primary">
		               提交
		            </button>
		         </div>
		      </div><!-- /.modal-content -->
		</div><!-- /.modal -->
</div>
    <footer class="footer">
      <div class="container">
        <p class="text-muted"><center>Copyright by 华南农业大学</center></p>
      </div>
    </footer>
  </body>
</html>
<script>
    function baseChange(obj) { 
       
		var val = $(obj).attr('value');
        var url = "<?php echo U('Superadmin/Safe/getChooseBase/val/"+val+"');?>";
        $.get(url, function(data, status){
            $('#base_id').val(data['base_id']);
            $('#base_name').val(data['base_name']);
            $('#base_addr').val(data['base_addr']);
            $('#base_source_water').val(data['base_source_water']);
            $('#base_scale').val(data['base_scale']);
            $('#base_contacts').val(data['base_contacts']);
            $('#base_tel').val(data['base_tel']);
            $('#base_coordinate').val(data['base_coordinate']);

        });
    } 
    function feedChange(obj) { 
       
		var val = $(obj).attr('value');
        var url = "<?php echo U('Superadmin/Safe/getChooseFeed/val/"+val+"');?>";
        $.get(url, function(data, status){
        	$('#feed_id').val(data['feed_id']);
            $('#feed_name').val(data['feed_name']);
            $('#feed_specifications').val(data['feed_specifications']);
        });
    } 
    function fryChange(obj) { 
       
		var val = $(obj).attr('value');
        var url = "<?php echo U('Superadmin/Safe/getChooseFry/val/"+val+"');?>";
        $.get(url, function(data, status){
        	$('#fry_id').val(data['fry_id']);
            $('#fry_name').val(data['fry_name']);
        });
    } 
    function medicineChange(obj) { 
       
		var val = $(obj).attr('value');
        var url = "<?php echo U('Superadmin/Safe/getChooseMedicine/val/"+val+"');?>";
        $.get(url, function(data, status){
            $('#medicine_id').val(data['medicine_id']);
            $('#medicine_name').val(data['medicine_name']);
            $('#medicine_use').val(data['medicine_use']);
            $('#medicine_precautions').val(data['medicine_precautions']);
        });
    } 
	$(document).ready(function(){
        $('#addBaseBtn').click(function(){

        	 var action= $('#addBase_form').attr('action');
        	 var Formattr=$('#addBase_form').serialize();
             $.post(action, Formattr,function(data,status) {
                 
                 if(status == "success") {
                    alert( "添加成功！");
                 }else{
                 	alert("添加失败！");
                 }
                 setTimeout("window.location.href=\"<?php echo U('Superadmin/Safe/index');?>\"",500);
             });
        });
        $('#addFeedBtn').click(function(){

        	 var action= $('#addFeed_form').attr('action');
        	 var Formattr=$('#addFeed_form').serialize();
             $.post(action, Formattr,function(data,status) {
                 
                 if(status == "success") {
                    alert( "添加成功！");
                 }else{
                 	alert("添加失败！");
                 }
                 setTimeout("window.location.href=\"<?php echo U('Superadmin/Safe/index');?>\"",500);
             });
        });
        $('#addFryBtn').click(function(){

        	 var action= $('#addFry_form').attr('action');
        	 var Formattr=$('#addFry_form').serialize();
             $.post(action, Formattr,function(data,status) {
                 
                 if(status == "success") {
                    alert( "添加成功！");
                 }else{
                 	alert("添加失败！");
                 }
                 setTimeout("window.location.href=\"<?php echo U('Superadmin/Safe/index');?>\"",500);
             });
        });
        $('#addMedicineBtn').click(function(){

        	 var action= $('#addMedicine_form').attr('action');
        	 var Formattr=$('#addMedicine_form').serialize();
             $.post(action, Formattr,function(data,status) {
                 
                 if(status == "success") {
                    alert( "添加成功！");
                 }else{
                 	alert("添加失败！");
                 }
                 setTimeout("window.location.href=\"<?php echo U('Superadmin/Safe/index');?>\"",500);
             });
        });

        $('#modifyBaseBtn').click(function(){

        	 var action= $('#modifyBase_form').attr('action');
        	 var Formattr=$('#modifyBase_form').serialize();
	         console.log(Formattr);
             $.post(action, Formattr,function(data,status) {
                 
                 if(status == "success") {
                    alert( "修改成功！");
                 }else{
                 	alert("修改失败！");
                 }
                 setTimeout("window.location.href=\"<?php echo U('Superadmin/Safe/index');?>\"",200);
             });
        });
        $('#modifyFeedBtn').click(function(){

        	 var action= $('#modifyFeed_form').attr('action');
        	 var Formattr=$('#modifyFeed_form').serialize();
	         console.log(Formattr);
             $.post(action, Formattr,function(data,status) {
                 
                 if(status == "success") {
                    alert( "修改成功！");
                 }else{
                 	alert("修改失败！");
                 }
                 setTimeout("window.location.href=\"<?php echo U('Superadmin/Safe/index');?>\"",200);
             });
        });
        $('#modifyFryBtn').click(function(){

        	 var action= $('#modifyFry_form').attr('action');
        	 var Formattr=$('#modifyFry_form').serialize();
	         console.log(Formattr);
             $.post(action, Formattr,function(data,status) {
                 
                 if(status == "success") {
                    alert( "修改成功！");
                 }else{
                 	alert("修改失败！");
                 }
                 setTimeout("window.location.href=\"<?php echo U('Superadmin/Safe/index');?>\"",200);
             });
        });
        $('#modifyMedicineBtn').click(function(){

        	 var action= $('#modifyMedicine_form').attr('action');
        	 var Formattr=$('#modifyMedicine_form').serialize();
	         console.log(Formattr);
             $.post(action, Formattr,function(data,status) {
                 
                 if(status == "success") {
                    alert( "修改成功！");
                 }else{
                 	alert("修改失败！");
                 }
                 setTimeout("window.location.href=\"<?php echo U('Superadmin/Safe/index');?>\"",200);
             });
        });


	});

</script>